<?php

/**
 * @author ngockv@gmail.com
 * @copyright 2012
 */

function logdb($oldValue, $timestamp=false){
  global $user, $database;
  
  if ($timestamp==false) $timestamp = time();
  
  $database->db_query("INSERT INTO logdbs(logdb_path, logdb_old_value, logdb_created, logdb_user_id) VALUES ('%s', '%s', %d, %d)", $_SERVER['REQUEST_URI'], serialize($oldValue), $timestamp, $user->user_info['user_id']);
}